package net.medplus.social.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Description:微信授权成功后返回的用戶信息
 *
 * @author: Xian XueLiang
 * @date: 2016/6/12
 */
public class User implements Parcelable{

    /**只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段*/
    private String unionid;
    /**用户的昵称*/
    private String nickname;
    /**用户所在国家*/
    private String country;
    /**	用户所在省份*/
    private String province;
    /**用户所在城市*/
    private String city;
    /**用户的语言，简体中文为zh_CN*/
    private String language;
    /**用户头像，最后一个数值代表正方形头像大小（有0、46、64、96、132数值可选，0代表640*640正方形头像），用户没有头像时该项为空。若用户更换头像，原有头像URL将失效。*/
    private String headimgurl;
    /**用户的性别，值为1时是男性，值为2时是女性，值为0时是未知*/
    private String sex;
    /**用户的标识，对当前公众号唯一*/
    private String openid;

    /**所有返回的原始字段信息*/
    private String allOriginalData;

    public User() {
    }

    protected User(Parcel in) {
        unionid = in.readString();
        nickname = in.readString();
        country = in.readString();
        province = in.readString();
        city = in.readString();
        language = in.readString();
        headimgurl = in.readString();
        sex = in.readString();
        openid = in.readString();
        allOriginalData = in.readString();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(unionid);
        dest.writeString(nickname);
        dest.writeString(country);
        dest.writeString(province);
        dest.writeString(city);
        dest.writeString(language);
        dest.writeString(headimgurl);
        dest.writeString(sex);
        dest.writeString(openid);
        dest.writeString(allOriginalData);
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getHeadimgurl() {
        return headimgurl;
    }

    public void setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getAllOriginalData() {
        return allOriginalData;
    }

    public void setAllOriginalData(String allOriginalData) {
        this.allOriginalData = allOriginalData;
    }

    public static Creator<User> getCREATOR() {
        return CREATOR;
    }
}
